<template>
    <button @click="addList">add</button>
    <ul>
        <li v-for="(item, index) of name" :key="index">
            {{ item }}
        </li>
    </ul>
</template>

<script>
export default {
    data() {
        return {
            name: ['a', 'b', 'c']
        }
    },
    methods: {
        addList() {
            // 变更6自动更新，替换3不更新
            this.name.push('d')
            this.name.concat(['e', 'f'])
            // 替换的更新方式
            this.name = this.name.concat(['g', 'h'])
        }
    },
}
</script>

<style lang="scss" scoped></style>